package com.meilele.dao.zhengchao;

import com.meilele.entity.zhengchao.FourLable;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface FourLableMapper {
    @Delete({
        "delete from four_lable",
        "where lable_id = #{lableId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer lableId);

    @Insert({
        "insert into four_lable (lable_id, lable_name, ",
        "big_type_id)",
        "values (#{lableId,jdbcType=INTEGER}, #{lableName,jdbcType=VARCHAR}, ",
        "#{bigTypeId,jdbcType=INTEGER})"
    })
    int insert(FourLable record);

    int insertSelective(FourLable record);

    @Select({
        "select",
        "lable_id, lable_name, big_type_id",
        "from four_lable",
        "where lable_id = #{lableId,jdbcType=INTEGER}"
    })
    @ResultMap("com.meilele.dao.zhengchao.FourLableMapper.BaseResultMap")
    FourLable selectByPrimaryKey(Integer lableId);

    int updateByPrimaryKeySelective(FourLable record);

    @Update({
        "update four_lable",
        "set lable_name = #{lableName,jdbcType=VARCHAR},",
          "big_type_id = #{bigTypeId,jdbcType=INTEGER}",
        "where lable_id = #{lableId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(FourLable record);

    @Select("select lable_id,lable_name,big_type_id from four_lable where big_type_id = #{id}")
    @ResultMap("com.meilele.dao.zhengchao.FourLableMapper.BaseResultMap")
    List<FourLable> findLableByTypeId(Integer id);
}